<html>
    <head>
        <script language='javascript' src="popcalendar.js"></script> 
    </head>
    <body>
        <H1 align = "center">Ingreso de Datos</H1>
    <center> 
        <form name="form1" method="post" ACTION="agregarPublicacionDocente.php">
            <TABLE border="1">                
                <TR>
                    <TD>DOCENTE</TD>
                    <td>
                        <select required = "si" name = "cedulaDocente" id = "sexo">
                            <?php
                           include("conectar.php");
                            $link = Conectarse();
                            $sql = "Select cedula, nombres || ' ' || apellidos as Nombres From docente;";
                            $resConsulta = pg_exec($link, $sql);
                            if (!$resConsulta) {
                                die("Error in SQL query:" . pg_last_error());
                            }
                            while ($row = pg_fetch_array($resConsulta)) {
                                echo "<option value=".$row[0].">$row[1]</option>";                      
                            }
                            ?>      
                        </select>
                    </td>
                </TR>
                <TR>                   
                    <TD>PUBLICACION</TD>
                    <TD>
                        <select required = "si" name = "codigoPublicacion" id = "cargo">
                            <?php
                            $sql1 = "Select codigopublicacion, descripcion From publicaciones;";
                            $resConsulta1 = pg_exec($link, $sql1);
                            while ($row = pg_fetch_array($resConsulta1)) {
                                echo "<option value=".$row[0].">$row[1]</option>"; 
                            }
                            ?>      
                        </select>
                    </TD>
                </TR>
                
                <TR>
                    <TD>FECHA PUBLICACION</TD>
                    <TD><input required = "si" name = "fecha" type = "text" id = "fecha" onClick = "popUpCalendar(this, form1.fecha, 'yyyy-mm-dd');" size = "12"></TD>
                </TR>
                <TR>
                    <TD>DESCRIPCION</TD>
                    <TD><INPUT required = "si" TYPE = "TextArea" NAME = "descripcion" SIZE = "20" MAXLENGTH = "30" 
                               value=".$cargo."></TD>
                </TR>                             
            </table>
            <INPUT TYPE = "submit" NAME = "accion" VALUE = "Grabar">
        </form>
    </center>
</html>